package com.situ.car.dao.Impl;

import com.situ.car.dao.ICategoryDao;
import com.situ.car.pojo.entity.Category;
import com.situ.car.pojo.entity.Role;
import com.situ.car.util.JDBCUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class CategoryDaoImpl implements ICategoryDao {
    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public List<Category> selectAll() {
        return template.query("select * from car_category", new BeanPropertyRowMapper<>(Category.class));
    }
}
